import request from '@/config/axios'

export interface MaintainInternalRelationVO {
  id: number
  orderNumber: string
  customerName: string
  customerCode: string
  dictStatus: number
  dictRelationType: number
  relationOrderNumber: string
  productNumber: string
  productName: string
  creatorName: string
}

// 查询质量管理-维修管理-内部联系单列表
export const getMaintainInternalRelationPage = async (params) => {
  return await request.get({ url: `/quality/maintain-internal-relation/page`, params })
}

// 查询质量管理-维修管理-内部联系单详情
export const getMaintainInternalRelation = async (id: number) => {
  return await request.get({ url: `/quality/maintain-internal-relation/get?id=` + id })
}

// 提交/保存质量管理-维修管理-内部联系单
export const updateMaintainInternalRelation = async (data) => {
  return await request.post({ url: `/quality/maintain-internal-relation/saveOrSubmit`, data })
}

// 删除质量管理-维修管理-内部联系单
export const deleteMaintainInternalRelation = async (id: number) => {
  return await request.delete({ url: `/quality/maintain-internal-relation/delete?id=` + id })
}

// 导出质量管理-维修管理-内部联系单 Excel
export const exportMaintainInternalRelation = async (data) => {
  return await request.download({ url: `/quality/maintain-internal-relation/export-excel`, data })
}

// 查询质量管理-维修管理-内部联系单详情-
export const getMaintainInternalRelationDetailOrderNum = async (keyword: string) => {
  return await request.get({ url: `/order/marketing-order-info/get?orderNumber=` + keyword })
}

// 查询质量管理-维修管理-内部联系单详情--{订单号、产品编号}
export const getMaintainInternalRelationDetailOrderDetail = async (params: object) => {
  return await request.get({ url: `/order/product-relation/list-all-simple`, params })
}
